<template>
	<view>
		<view class="head" :style="{height:navheight+5 +'px'}">
			<view class="head_left" @tap="back()" :style="{'padding-top':navheight-40 +'px'}">
				<!-- <image src="../../../static/newshouye/fanhuiqian.png" mode=""></image> -->
				<text>返回</text>
			</view>
			<view class="head_mid" :style="{'padding-top':navheight-32 +'px'}">
				设置
			</view>
			<view class="head_right">

			</view>
		</view>
		<view class="body">
			<view class="body_item" @tap="toSafe">
				<text>账户与安全</text>
				<view class="body_item_right">
				<!-- 	<image class="rightImg" src="../../../static/wode/arrow_right.png" mode=""></image> -->
				</view>
			</view>
			<view class="body_item" @tap="toNews">
				<text>新消息通知</text>
				<view class="body_item_right">
					<!-- <image class="rightImg" src="../../../static/wode/arrow_right.png" mode=""></image> -->
				</view>
			</view>
			<view class="body_item" @tap="toPrivacy">
				<text>隐私</text>
				<view class="body_item_right">
					<!-- <image class="rightImg" src="../../../static/wode/arrow_right.png" mode=""></image> -->
				</view>
			</view>
			<view class="body_item" @tap="toCurrency">
				<text>通用</text>
				<view class="body_item_right">
					<!-- <image class="rightImg" src="../../../static/wode/arrow_right.png" mode=""></image> -->
				</view>
			</view>
			<view class="body_item" @tap="toAboutUs">
				<text>关于我们</text>
				<view class="body_item_right">
					<!-- <image class="rightImg" src="../../../static/wode/arrow_right.png" mode=""></image> -->
				</view>
			</view>
			<view class="body_item noBorder" @tap="toClearCache">
				<text>清除缓存</text>
				<view class="body_item_right">
					<!-- <image class="rightImg" src="../../../static/wode/arrow_right.png" mode=""></image> -->
				</view>
			</view>
			<view  @tap="outApp" style="width: 648.7rpx;height: 85.76rpx;line-height: 85.76rpx;background: #EE7B30;text-align: center;color: #FFFFFF;font-size: 32rpx;border-radius: 42.9rpx;margin: 81rpx 0 72rpx 50.736rpx;">
				退出登录
			</view>
		</view>
	</view>
</template>

<script>
	import webim from '../../../common/webim_wx.min.js'

	export default {
		data() {
			return {
				navheight:this.$navheight,
			};
		},
		methods: {
			toSafe() {
				uni.navigateTo({
					url: "../safe/safe"
				})
			},
			toNews() {
				uni.navigateTo({
					url: "../News/News"
				})
			},
			toPrivacy() {
				uni.navigateTo({
					url: "../Privacy/Privacy"
				})
			},
			toCurrency() {
				uni.navigateTo({
					url: "../Currency/Currency"
				})
			},
			toAboutUs() {
				uni.navigateTo({
					url: "../AboutUs/AboutUs"
				})
			},
			back() { //返回
				uni.navigateBack({
					delta: 1
				})
			},
			toClearCache(){
				uni.clearStorage({
					success: function (res) {
						let pages = getCurrentPages(); // 当前页面
						let beforePage = pages[pages.length - 2]; //
						uni.navigateBack({
						     success: function() {
						         beforePage.onLoad(); // 执行前一个页面的onLoad方法
						     }
						 });
					}
				})
			},
			outApp() {
				let self = this
				uni.showModal({
					cancelText:'否',
					confirmText:'是',
					content: '是否退出登录？',
					success: function(res) {
						if(res.confirm){
							try{
								uni.removeStorageSync('user_token')
								uni.removeStorageSync('userif_list')
								uni.removeStorageSync('kaquan')
								uni.reLaunch({
									url:'/pages/tabBer/login/logins'
								})
							}catch(e){}
						}else{
							
						}
					}
				})
			},
		},
	}
</script>

<style scoped>
	.head {
		width: 100%;
		display: flex;
		justify-content: space-between;
		height: 162upx;
		background: #ffffff;
		padding: 0 24upx;
		z-index: 200;
	}

	.head image {
		width: 20upx;
		height: 36upx;
		margin-right: 9upx;
	}

	.head_left {
		height: 82upx;
		width: 106upx;
		display: flex;
		align-items: center;
		line-height: 82upx;
		color: #666666;
		font-size: 32upx;
		padding-top: 70upx;
	}

	.head_mid {
		padding-top: 90upx;
	}

	.head_right {
		width: 106upx;
	}

	.body {
		margin-top: 20upx;
	}

	.body_item {
		background: #ffffff;
		display: flex;
		justify-content: space-between;
		padding: 24upx 24upx;
		border-bottom: 1px solid #e6e6e6;
		font-size: 32upx;
	}

	.rightImg {
		width: 16upx;
		height: 28upx;
		margin-left: 30upx;
	}

	.noBorder {
		border: none;
	}

	.logout {
		position: absolute;
		bottom: 60upx;
		left: 24upx;
	}
</style>
